<template>
	<view class="container" >
		<view 
		v-for="(dateItem1,index1) in list1" 
		:key="index1" 
		class='item'
		@click="outDate(dateItem1)">	
		   {{dateItem1}}
	    </view>
		
<!-- 		<view
		v-for="(dateItem2,index2) in list2" 
		:key="index2" 
		class='item'
		@click="outDate(dateItem2)">	
		   {{dateItem2}}
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list1:[],
				dataItem1:"",
				list2:[],
				dataItem2:"",
				mode:""
			}
		},
		
		onLoad(res){
			this.mode=res.mode,
			this.loadTimeList()
			
			
		},
		
		methods: {
			async loadTimeList(){
				let _that=this
				let data2={
					mode:this.mode,
				};
				console.log("mode",this.mode)
				await _that.$myRequest("/frontend/historylist?uuid=706655b1367b","POST",data2).then(resp=>{
					this.list1=resp.data.time_list
				});
				
			},
			outDate(dateItem){
				let that =this;
				uni.navigateTo({
					url:"/pages/index/succ"
				})
				wx.downloadFile({
				      url: "http://43.139.95.60:4008/MotiSrc/frontend/historyexcel/706655b1367b/"+dateItem,
				      success(res){
				        const filePath=res.tempFilePath
				        wx.openDocument({
				          filePath: filePath,
				          showMenu:true
				    
				        })
				      }
				    })

           }
		    }
	}
</script>

<style>
	.container{
		padding-top: 40rpx;
		display:flex;
		flex-direction: column;
		text-align: center;
		/* justify-content:center; */
		align-items: center;
	}
	.item{
		width:100%;
		display: flex;
		flex-direction: column;
		margin: 20rpx 0rpx;
		border-radius: 60rpx;
		padding:20rpx  0rpx;
		background-color: #F8F8F8;
		/*  阴影 */
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.15);
		
	}

</style>
